import request from '@/request'
import {C2B} from '@/utils/wordtransfer.js'

// 查询搜索并分页
export const findPages = (data) => {
    return request.post("/adverts/list",data)    
}

// 保存和更新
export const saveUpdate = (data) => {
    return request.post("/adverts/saveupdate",data)    
}

// id查询明细
export const getById = (id) => {
    return request.post(`/adverts/get/${id}`,{})    
}

// 修改状态
export const updateStatus = (id,field,value) => {
    field = C2B(field)
    return request.post(`/adverts/status/${id}/${field}/${value}`,{})
}

// 回收站
export const findPagesRecyle = (data) => {
    return request.post("/adverts/recyle",data)
}

// 批量逻辑删除
export const batchDels = (ids) => {
    return request.post("/adverts/batch/dels",{ids})
}

// 批量逻辑恢复
export const batchRecovers = (ids) => {
    return request.post("/adverts/batch/recover",{ids})
}

// 批量彻底删除
export const batchRemoves = (ids) => {
    return request.post("/adverts/batch/remove",{ids})
}

// 物理删除
export const removeById = (id) => {
    return request.post(`/adverts/remove/${id}`,{})
}

//恢复删除
export const recoverById = (id) => {
    return request.post(`/adverts/recover/${id}`,{})
}

// 逻辑删除
export const delById = (id) => {
    return request.post(`/adverts/del/${id}`,{})
}

// 复制
export const copyData = (id) => {
    return request.post(`/adverts/copy/${id}`, {})
}
